import React, { useEffect, useState } from "react";
import dayjs from 'dayjs'
export const Time = () => {
    let [date, setDate] = useState(dayjs())

    useEffect(() => {
        let t = setInterval(() => {
            setDate(dayjs())
        }, 1000)
        return () => {
            clearInterval(t)
        }
    }, [])
    return (
        <div className="time">
            {date.format('YYYY-MM-DD:HH:MM:ss')}
        </div>
    )
}